#include <stdio.h>
#include <time.h>
struct clock
{
	int hour;
	int minute;
	int second;
};
typedef struct clock c;
void show(c * clo)
{
	printf("\033[2J");
	printf("%02d:%02d:%02d\n",clo->hour,clo->minute,clo->second);
}
void timer(c * clo)
{
	if(clo->second == 59)
	{
		clo->second = 0;
		clo->minute++;
	}
	else
	{
		clo->second++;
	}
}
int main(void)
{
	c clo = {0,0,0};
	time_t current_time;
	time(&current_time);
	while(1)
	{
		if((time((time_t *)NULL) - current_time))
		{
			time(&current_time);
			timer(&clo);
			show(&clo);
		}
	}	
}
